{% load i18n%}
  <aside class="main-sidebar sidebar-dark-primary elevation-4">

    <a href="/" class="brand-link">
<img src="{{company_picture.url}}" alt="{{company_name}} Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
        <span class="brand-text font-weight-light">{{company_name}}</span>
    </a>

    <div class="sidebar">

      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <li class="nav-item">
            <a href="/" class="nav-link">
              <i class="nav-icon fas fa-tachometer-alt text-orange"></i>
              <p>
                {% translate "Dashboard" %}
              </p>
            </a>
          </li>

  {% if user.groups.all.0|stringformat:'s' == "administrator" %}

          <li class="nav-item">
            <a href="/" class="nav-link">
              <i class="nav-icon fas fa-cogs text-white"></i>
              <p>
                {% translate "Configuration" %}
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>

            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'user_list' %}" class="nav-link">
                  <i class="nav-icon fas fa-id-card"></i>
                  <p>{% translate "Users" %}</p>
                </a>
              </li>
            </ul>

            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'user_add' %}" class="nav-link">
                  <i class="nav-icon fas fa-users-cog"></i>
                  <p>{% translate "Add User" %}</p>
                </a>
              </li>
            </ul>
            
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'settings' %}" class="nav-link">
                  <i class="nav-icon fas fa-cog"></i>
                  <p>{% translate "Settings" %}</p>
                </a>
              </li>
            </ul>

          </li>
  {% endif %}


          <li class="nav-item">
            <a href="{% url 'customer_list' %}" class="nav-link">
              <i class="nav-icon fas fa-building text-yellow"></i>
              <p>
                {% translate "Customers" %}
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>

            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'customer_list' %}" class="nav-link">
                  <i class="nav-icon fas fa-table"></i>
                  <p>{% translate "All Customers" %}</p>
                </a>
              </li>
            </ul>

        {% if user.groups.all.0|stringformat:'s' == "administrator" %}
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'customer_add' %}" class="nav-link">
                  <i class="nav-icon fas fa-edit"></i>
                  <p>{% translate "Add Customer" %}</p>
                </a>
              </li>
            </ul>
        {% endif %}

          </li>

          
          <li class="nav-item">
            <a href="{% url 'product_list' %}" class="nav-link">
              <i class="nav-icon fa fa-cube text-primary"></i>
              <p>
                {% translate "Products" %}
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>

            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'product_list' %}" class="nav-link">
                  <i class="nav-icon fas fa-table"></i>
                  <p>{% translate "All Products" %}</p>
                </a>
              </li>
            </ul>

        {% if user.groups.all.0|stringformat:'s' == "administrator" %}
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'product_add' %}" class="nav-link">
                  <i class="nav-icon fas fa-edit"></i>
                  <p>{% translate "Add Product" %}</p>
                </a>
              </li>
            </ul>
        {% endif %}

          </li>


          <li class="nav-item">
            <a href="{% url 'report_list' %}" class="nav-link">
              <i class="nav-icon fas fa-copy text-success"></i>
              <p>
                {% translate "Reports" %}
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>

            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'report_list' %}" class="nav-link">
                  <i class="nav-icon fas fa-table"></i>
                  <p>{% translate "All Reports" %}</p>
                </a>
              </li>
            </ul>

        {% if user.groups.all.0|stringformat:'s' == "administrator" %}
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'report_add' %}" class="nav-link">
                  <i class="nav-icon fas fa-edit"></i>
                  <p>{% translate "Add Report" %}</p>
                </a>
              </li>
            </ul>
        {% endif %}

            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'deliverable_list' %}" class="nav-link">
                  <i class="nav-icon fas fa-download"></i>
                  <p>
                    {% translate "All Deliverables" %}
                  </p>
                </a>
              </li>
            </ul>

          </li>


          <li class="nav-item">
            <a href="{% url 'openfindings' %}" class="nav-link">
              <i class="nav-icon fas fa-bug text-danger"></i>
              <p>
                {% translate "Findings" %}
                <i class="fas fa-angle-left right"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'openfindings' %}" class="nav-link">
                  <i class="nav-icon fas fa-exclamation-triangle"></i>
                  <p>{% translate "Open Findings" %}</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="{% url 'closedfindings' %}" class="nav-link">
                  <i class="nav-icon fas fa-toolbox"></i>
                  <p>{% translate "Closed Findings" %}</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="{% url 'template_list' %}" class="nav-link">
                  <i class="far fa-file-alt nav-icon"></i>
                  <p>{% translate "Finding templates" %}</p>
                </a>
              </li>

            {% if user.groups.all.0|stringformat:'s' == "administrator" %}
              <li class="nav-item">
                <a href="{% url 'template_add' %}" class="nav-link">
                  <i class="fas fa-file-code nav-icon"></i>
                  <p>{% translate "Add Finding template" %}</p>
                </a>
              </li>
            {% endif %}

            </ul>
          </li>

          <li class="nav-item">
            <a href="{% url 'cwe_list' %}" class="nav-link">
              <i class="nav-icon fas fa-fingerprint text-warning"></i>
              <p>
                {% translate "CWE" %}
                <i class="fas fa-angle-left right"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'cwe_list' %}" class="nav-link">
                  <i class="nav-icon fas fa-radiation-alt"></i>
                  <p>{% translate "CWE List" %}</p>
                </a>
              </li>

            {% if user.groups.all.0|stringformat:'s' == "administrator" %}
              <li class="nav-item">
                <a href="{% url 'cwe_add' %}" class="nav-link">
                  <i class="fas fa-edit nav-icon"></i>
                  <p>{% translate "Add CWE" %}</p>
                </a>
              </li>
            {% endif %}

            </ul>
          </li>

          <li class="nav-item">
            <a href="{% url 'owasp_list' %}" class="nav-link">
              <i class="nav-icon fas fa-fingerprint text-info"></i>
              <p>
                {% translate "OWASP" %}
                <i class="fas fa-angle-left right"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="{% url 'owasp_list' %}" class="nav-link">
                  <i class="nav-icon fas fa-radiation-alt"></i>
                  <p>{% translate "OWASP List" %}</p>
                </a>
              </li>

            {% if user.groups.all.0|stringformat:'s' == "administrator" %}
              <li class="nav-item">
                <a href="{% url 'owasp_add' %}" class="nav-link">
                  <i class="fas fa-edit nav-icon"></i>
                  <p>{% translate "Add OWASP" %}</p>
                </a>
              </li>
            {% endif %}

            </ul>
          </li>


        </ul>
      </nav>
    </div>
  </aside>